AnnieRoot.gcow=AnnieRoot.gcow||{};
AnnieRoot.gcow.NormalCow1=function(){
	var s = this;
	annie.MovieClip.call(s);
	/*_a2x_need_start*/s.cowHitTestArea=null;/*_a2x_need_end*/
	annie.initRes(s,"gcow","NormalCow1");
	s.name = 'cow';
	//your code here
	s.addEventListener(annie.Event.ADD_TO_STAGE, s.addToStage.bind(s));
};
annie.A2xExtend(AnnieRoot.gcow.NormalCow1,annie.MovieClip);
AnnieRoot.gcow.NormalCow1.prototype.status = 0;//0正常状态，1套中状态
AnnieRoot.gcow.NormalCow1.prototype.type = 1;//
AnnieRoot.gcow.NormalCow1.prototype.levelSpeed = [10, 16, 18, 20, 22, 23, 24];
AnnieRoot.gcow.NormalCow1.prototype.speed = 10;//普通牛初始速度
//进入场景
AnnieRoot.gcow.NormalCow1.prototype.addToStage = function (e) {
	var s = this;
	s.updateCowSpeed(AnnieRoot.gameGlobalData.level);
	s.startMoving();
};
AnnieRoot.gcow.NormalCow1.prototype.startMoving = function (e) {
	var s = this;
	s.addEventListener(annie.Event.ENTER_FRAME, s.bmh = s.cowMovingHandler.bind(s));
};
AnnieRoot.gcow.NormalCow1.prototype.stopMoving = function (e) {
	var s = this;
	s.removeEventListener(annie.Event.ENTER_FRAME, s.bmh);
};
/**
 * 牛牛移动
 * @param e
 */
AnnieRoot.gcow.NormalCow1.prototype.cowMovingHandler = function (e) {
	var s = this;
	s.x -= s.speed;
	if (s.x < -360) {
		s.removeEventListener(annie.Event.ENTER_FRAME, s.bmh);
		s.bmh = null;
		annie.globalDispatcher.dispatchEvent('recoveryCowEvent', s);//抛出回收牛牛事件，回收视窗以外的牛牛到牛牛池中
		if (s.parent) {
			s.parent.removeChild(s);//把视窗外的牛牛移除舞台
		}
	}
};
AnnieRoot.gcow.NormalCow1.prototype.updateCowSpeed = function (level) {
	var s = this;
	if (level > 6) {
		level = 6;
	}
	s.speed = s.levelSpeed[level];
};
